import { defineComponent, KeepAlive, DefineComponent } from 'vue';
import { RouterView, RouteLocationNormalized } from 'vue-router';
import { useTitle } from '/@/hooks/web/useTitle';
import { useRouteStore } from '/@/store/modules/route';
// import { useRoute } from 'vue-router';
import 'vant/lib/index.css';
export default defineComponent({
  name: 'App',
  setup() {
    useTitle();
    const routeStore = useRouteStore();
    // const route = useRoute();
    return () => (
      <section id='main-container'>
        <RouterView>
          {{
            default: ({ Component, route }: { Component: DefineComponent; route: RouteLocationNormalized }) => {
              return (
                <KeepAlive include={routeStore.getCacheRouteList}>
                  <Component key={route.fullPath} />
                </KeepAlive>
              );
            },
          }}
        </RouterView>
      </section>
    );
  },
});
